/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package momo.impl;

import momo.DisappearOperator;
import momo.MomoPackage;
import momo.Operator;
import momo.RotateOperator;
import momo.TranslateOperator;
import momo.ZoomOperator;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Operator</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link momo.impl.OperatorImpl#getTranslate <em>Translate</em>}</li>
 *   <li>{@link momo.impl.OperatorImpl#getRotate <em>Rotate</em>}</li>
 *   <li>{@link momo.impl.OperatorImpl#getZoom <em>Zoom</em>}</li>
 *   <li>{@link momo.impl.OperatorImpl#getDisappear <em>Disappear</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class OperatorImpl extends EObjectImpl implements Operator {
	/**
	 * The cached value of the '{@link #getTranslate() <em>Translate</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getTranslate()
	 * @generated
	 * @ordered
	 */
	protected TranslateOperator translate;

	/**
	 * The cached value of the '{@link #getRotate() <em>Rotate</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getRotate()
	 * @generated
	 * @ordered
	 */
	protected RotateOperator rotate;

	/**
	 * The cached value of the '{@link #getZoom() <em>Zoom</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getZoom()
	 * @generated
	 * @ordered
	 */
	protected ZoomOperator zoom;

	/**
	 * The cached value of the '{@link #getDisappear() <em>Disappear</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDisappear()
	 * @generated
	 * @ordered
	 */
	protected DisappearOperator disappear;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected OperatorImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return MomoPackage.Literals.OPERATOR;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public TranslateOperator getTranslate() {
		if (translate != null && translate.eIsProxy()) {
			InternalEObject oldTranslate = (InternalEObject)translate;
			translate = (TranslateOperator)eResolveProxy(oldTranslate);
			if (translate != oldTranslate) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, MomoPackage.OPERATOR__TRANSLATE, oldTranslate, translate));
			}
		}
		return translate;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public TranslateOperator basicGetTranslate() {
		return translate;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setTranslate(TranslateOperator newTranslate) {
		TranslateOperator oldTranslate = translate;
		translate = newTranslate;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, MomoPackage.OPERATOR__TRANSLATE, oldTranslate, translate));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public RotateOperator getRotate() {
		if (rotate != null && rotate.eIsProxy()) {
			InternalEObject oldRotate = (InternalEObject)rotate;
			rotate = (RotateOperator)eResolveProxy(oldRotate);
			if (rotate != oldRotate) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, MomoPackage.OPERATOR__ROTATE, oldRotate, rotate));
			}
		}
		return rotate;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public RotateOperator basicGetRotate() {
		return rotate;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setRotate(RotateOperator newRotate) {
		RotateOperator oldRotate = rotate;
		rotate = newRotate;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, MomoPackage.OPERATOR__ROTATE, oldRotate, rotate));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ZoomOperator getZoom() {
		if (zoom != null && zoom.eIsProxy()) {
			InternalEObject oldZoom = (InternalEObject)zoom;
			zoom = (ZoomOperator)eResolveProxy(oldZoom);
			if (zoom != oldZoom) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, MomoPackage.OPERATOR__ZOOM, oldZoom, zoom));
			}
		}
		return zoom;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ZoomOperator basicGetZoom() {
		return zoom;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setZoom(ZoomOperator newZoom) {
		ZoomOperator oldZoom = zoom;
		zoom = newZoom;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, MomoPackage.OPERATOR__ZOOM, oldZoom, zoom));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public DisappearOperator getDisappear() {
		if (disappear != null && disappear.eIsProxy()) {
			InternalEObject oldDisappear = (InternalEObject)disappear;
			disappear = (DisappearOperator)eResolveProxy(oldDisappear);
			if (disappear != oldDisappear) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, MomoPackage.OPERATOR__DISAPPEAR, oldDisappear, disappear));
			}
		}
		return disappear;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public DisappearOperator basicGetDisappear() {
		return disappear;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setDisappear(DisappearOperator newDisappear) {
		DisappearOperator oldDisappear = disappear;
		disappear = newDisappear;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, MomoPackage.OPERATOR__DISAPPEAR, oldDisappear, disappear));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case MomoPackage.OPERATOR__TRANSLATE:
				if (resolve) return getTranslate();
				return basicGetTranslate();
			case MomoPackage.OPERATOR__ROTATE:
				if (resolve) return getRotate();
				return basicGetRotate();
			case MomoPackage.OPERATOR__ZOOM:
				if (resolve) return getZoom();
				return basicGetZoom();
			case MomoPackage.OPERATOR__DISAPPEAR:
				if (resolve) return getDisappear();
				return basicGetDisappear();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case MomoPackage.OPERATOR__TRANSLATE:
				setTranslate((TranslateOperator)newValue);
				return;
			case MomoPackage.OPERATOR__ROTATE:
				setRotate((RotateOperator)newValue);
				return;
			case MomoPackage.OPERATOR__ZOOM:
				setZoom((ZoomOperator)newValue);
				return;
			case MomoPackage.OPERATOR__DISAPPEAR:
				setDisappear((DisappearOperator)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case MomoPackage.OPERATOR__TRANSLATE:
				setTranslate((TranslateOperator)null);
				return;
			case MomoPackage.OPERATOR__ROTATE:
				setRotate((RotateOperator)null);
				return;
			case MomoPackage.OPERATOR__ZOOM:
				setZoom((ZoomOperator)null);
				return;
			case MomoPackage.OPERATOR__DISAPPEAR:
				setDisappear((DisappearOperator)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case MomoPackage.OPERATOR__TRANSLATE:
				return translate != null;
			case MomoPackage.OPERATOR__ROTATE:
				return rotate != null;
			case MomoPackage.OPERATOR__ZOOM:
				return zoom != null;
			case MomoPackage.OPERATOR__DISAPPEAR:
				return disappear != null;
		}
		return super.eIsSet(featureID);
	}

} //OperatorImpl
